from django.conf.urls import url
from rest_framework_jwt.views import obtain_jwt_token

from . import views

urlpatterns = [
    #/users/usernames/(?P<username>\w{5,20})/count/
    url(r'^usernames/(?P<username>\w{5,20})/count/$',views.RegisterUsernameCountAPIView.as_view(),name='usernamecount'),
    url(r'^phones/(?P<mobile>1[345789]\d{9})/count/$',views.RegisterPhoneCountAPIView.as_view(),name='phonecount'),
    url(r'^$',views.RegisterCreateView1.as_view()),
    url(r'^auths/$', views.UserAuthorizationView.as_view()),
    url(r'^infos/$', views.UserCenterInfoAPIView.as_view()),
    url(r'^emails/$',views.EmailUpdateAPIView.as_view()),
    url(r'^emails/verification/$',views.EmailVerificationAPIView.as_view()),
    url(r'^addresses/$',views.AddressesCreateAPIView.as_view()),
    url(r'^addresses/(?P<pk>\d+)/$',views.AddressesCreateAPIView.as_view()),
    url(r'^addresses/(?P<pk>\d+)/status/$',views.AddressStatus.as_view()),
    url(r'^browerhistories/$',views.UserHistoryAPIView.as_view()),
    url(r'^(?P<pk>\d+)/password/$',views.UpdateApive.as_view(),name='changepassword'),
    #忘记密码
    url(r'^accounts/(?P<username>\w+)/sms/token/$', views.VerifyAccountAPIView.as_view()),
    url(r'^verification/smscodes/', views.PasswordSmscodeAPIView.as_view()),
    url(r'^accounts/(?P<username>\w+)/password/token/$', views.VSmscodeAPIView.as_view()),
    url(r'^(?P<user_id>\d+)/re_password/$', views.VSmscodeAPIView.as_view()),
]